From: Colin Walters Date: Fri, 8 Oct 2021 12:59:52 +0000 (-0400) Subject: remote: Fix gcc `-fanalyzer` warning X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2^2~16^2~6 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a8eed03a1974c285cb7ddf550c7385a4783bb97d;p=ostree.git remote: Fix gcc `-fanalyzer` warning In general, we're probably going to need to change most of our `g_return_if_fail` to `g_assert`. The analyzer flags that the function can return `NULL`, but the caller isn't prepared for this. In practice, let's abort. --- diff --git a/src/libostree/ostree-remote.c b/src/libostree/ostree-remote.c index 2b068e15..93c1a328 100644 --- a/src/libostree/ostree-remote.c +++ b/src/libostree/ostree-remote.c @@ -65,8 +65,8 @@ ostree_remote_new_dynamic (const gchar *name, { OstreeRemote *remote; - g_return_val_if_fail (name != NULL && *name != '\0', NULL); - g_return_val_if_fail (refspec_name == NULL || *refspec_name != '\0', NULL); + g_assert (name != NULL && *name != '\0'); + g_assert (refspec_name == NULL || *refspec_name != '\0'); remote = g_slice_new0 (OstreeRemote); remote->ref_count = 1;